﻿<ResourceDictionary 
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
  
  	<SolidColorBrush x:Key="TabControlOuterBorder" Color="#121011"/>
	<SolidColorBrush x:Key="TabControlInnerBorder" Color="#5c5e5b"/>
  
    <LinearGradientBrush x:Key="MenuBackground" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#727272" Offset="0"/>
        <GradientStop Color="#323230" Offset="1"/>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="MenuBackgroundHover" StartPoint="0.5,0" EndPoint="0.5,1">
        <GradientStop Color="#65da5e69" Offset="0"/>
        <GradientStop Color="#65d12e27" Offset="1"/>
    </LinearGradientBrush>
	
	
	<LinearGradientBrush x:Key="MenuSelected" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#da5e69" Offset="0"/>
		<GradientStop Color="#d12e27" Offset="1"/>
	</LinearGradientBrush>

    <SolidColorBrush x:Key="MenuBorder" Color="#5c5e5b"/>
    <SolidColorBrush x:Key="MenuBorderHover" Color="#d12e27"/>
    <SolidColorBrush x:Key="MenuInnerBorder" Color="#65d12e27"/>
    <SolidColorBrush x:Key="MenuForeground" Color="White"/>
    <SolidColorBrush x:Key="MenuItemBackground" Color="#727272"/>

    <SolidColorBrush x:Key="MenuItemIconBackground" Color="#323230"/>






    <Style TargetType="{x:Type Menu}">
        <Setter Property="Background" Value="{StaticResource MenuBackground}"/>
        <Setter Property="Foreground" Value="{StaticResource MenuForeground}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Menu}">
                    <Border SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{StaticResource MenuBorder}" BorderThickness="0,0,0,1" Padding="{TemplateBinding Padding}">
                        <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <Geometry x:Key="Checkmark">M 0,5.1 L 1.7,5.2 L 3.4,7.1 L 8,0.4 L 9.2,0 L 3.3,10.8 Z</Geometry>
    <LinearGradientBrush x:Key="MenuItemSelectionFill" EndPoint="0,1" StartPoint="0,0">
        <GradientStop Color="#34C5EBFF" Offset="0"/>
        <GradientStop Color="#3481D8FF" Offset="1"/>
    </LinearGradientBrush>

    <ControlTemplate x:Key="{ComponentResourceKey ResourceId=SubmenuItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Grid SnapsToDevicePixels="true">
            <Rectangle x:Name="Bg" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" RadiusX="2" RadiusY="2"/>
            <Rectangle Margin="1" x:Name="InnerBorder" RadiusX="2" RadiusY="2"/>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition MinWidth="24" Width="Auto" SharedSizeGroup="MenuItemIconColumnGroup"/>
                    <ColumnDefinition Width="4"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="37"/>
                    <ColumnDefinition Width="Auto" SharedSizeGroup="MenuItemIGTColumnGroup"/>
                    <ColumnDefinition Width="17"/>
                </Grid.ColumnDefinitions>
                <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="1" x:Name="Icon" VerticalAlignment="Center" ContentSource="Icon"/>
                <Border Visibility="Hidden" Margin="1" x:Name="GlyphPanel" Width="22" Height="22" Background="#E6EFF4" BorderBrush="#CDD3E6" BorderThickness="1" CornerRadius="3">
                    <Path FlowDirection="LeftToRight" x:Name="Glyph" Width="9" Height="11" Fill="#0C12A1" Data="{StaticResource Checkmark}"/>
                </Border>
                <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="{TemplateBinding Padding}" Grid.Column="2" ContentSource="Header" RecognizesAccessKey="True"/>
                <TextBlock Margin="{TemplateBinding Padding}" Grid.Column="4" Text="{TemplateBinding InputGestureText}"/>
            </Grid>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="Icon" Value="{x:Null}">
                <Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
            </Trigger>
            <Trigger Property="IsChecked" Value="true">
                <Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible"/>
                <Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
            </Trigger>
            <Trigger Property="IsHighlighted" Value="true">
                <Setter Property="Fill" TargetName="Bg" Value="{StaticResource MenuBackgroundHover}"/>
                <Setter Property="Stroke" TargetName="Bg" Value="{StaticResource MenuBorderHover}"/>
                <Setter Property="Stroke" TargetName="InnerBorder" Value="#FFFFFF"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
                <Setter Property="Foreground" Value="#FF9A9A9A"/>
                <Setter Property="Background" TargetName="GlyphPanel" Value="#EEE9E9"/>
                <Setter Property="BorderBrush" TargetName="GlyphPanel" Value="#DBD6D6"/>
                <Setter Property="Fill" TargetName="Glyph" Value="#848589"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <ControlTemplate x:Key="{ComponentResourceKey ResourceId=SubmenuContent, TypeInTargetAssembly={x:Type FrameworkElement}}" TargetType="{x:Type ContentControl}">
        <Border Background="{StaticResource MenuItemBackground}" BorderBrush="{StaticResource MenuBorder}" BorderThickness="1">
            <Grid>
                <Rectangle HorizontalAlignment="Left" Margin="2" Width="28" Fill="{StaticResource MenuItemIconBackground}" RadiusX="2" RadiusY="2"/>
                <Rectangle HorizontalAlignment="Left" Margin="30,2,0,2" Width="1" Fill="Transparent"/>
                <Rectangle HorizontalAlignment="Left" Margin="31,2,0,2" Width="1" Fill="Transparent"/>
                <ContentPresenter Margin="1,0" Grid.ColumnSpan="2"/>
            </Grid>
        </Border>
    </ControlTemplate>
    <MenuScrollingVisibilityConverter x:Key="MenuScrollingVisibilityConverter"/>
    <Style x:Key="MenuScrollButton" BasedOn="{x:Null}" TargetType="{x:Type RepeatButton}">
        <Setter Property="ClickMode" Value="Hover"/>
        <Setter Property="MinWidth" Value="0"/>
        <Setter Property="MinHeight" Value="0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <DockPanel SnapsToDevicePixels="true" Background="Transparent">
                        <Rectangle x:Name="R1" Width="1" Fill="Transparent" DockPanel.Dock="Right"/>
                        <Rectangle x:Name="B1" Height="1" Fill="Transparent" DockPanel.Dock="Bottom"/>
                        <Rectangle x:Name="L1" Width="1" Fill="Transparent" DockPanel.Dock="Left"/>
                        <Rectangle x:Name="T1" Height="1" Fill="Transparent" DockPanel.Dock="Top"/>
                        <ContentPresenter HorizontalAlignment="Center" Margin="2,2,2,2" x:Name="ContentContainer" VerticalAlignment="Center"/>
                    </DockPanel>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter Property="Fill" TargetName="R1" Value="{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}"/>
                            <Setter Property="Fill" TargetName="B1" Value="{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}"/>
                            <Setter Property="Fill" TargetName="L1" Value="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}"/>
                            <Setter Property="Fill" TargetName="T1" Value="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}"/>
                            <Setter Property="Margin" TargetName="ContentContainer" Value="3,3,1,1"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Geometry x:Key="UpArrow">M 0,4 L 3.5,0 L 7,4 Z</Geometry>
    <Geometry x:Key="DownArrow">M 0,0 L 3.5,4 L 7,0 Z</Geometry>
    <Style x:Key="{ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}" BasedOn="{x:Null}" TargetType="{x:Type ScrollViewer}">
        <Setter Property="HorizontalScrollBarVisibility" Value="Hidden"/>
        <Setter Property="VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ScrollViewer}">
                    <Grid SnapsToDevicePixels="true">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Border Grid.Column="0" Grid.Row="1">
                            <ScrollContentPresenter Margin="{TemplateBinding Padding}"/>
                        </Border>
                        <RepeatButton Focusable="false" Style="{StaticResource MenuScrollButton}" Grid.Column="0" Grid.Row="0" Command="{x:Static ScrollBar.LineUpCommand}" CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}">
                            <RepeatButton.Visibility>
                                <MultiBinding FallbackValue="Visibility.Collapsed" Converter="{StaticResource MenuScrollingVisibilityConverter}" ConverterParameter="0">
                                    <Binding Path="ComputedVerticalScrollBarVisibility" RelativeSource="{RelativeSource TemplatedParent}"/>
                                    <Binding Path="VerticalOffset" RelativeSource="{RelativeSource TemplatedParent}"/>
                                    <Binding Path="ExtentHeight" RelativeSource="{RelativeSource TemplatedParent}"/>
                                    <Binding Path="ViewportHeight" RelativeSource="{RelativeSource TemplatedParent}"/>
                                </MultiBinding>
                            </RepeatButton.Visibility>
                            <Path Fill="{DynamicResource {x:Static SystemColors.MenuTextBrushKey}}" Data="{StaticResource UpArrow}"/>
                        </RepeatButton>
                        <RepeatButton Focusable="false" Style="{StaticResource MenuScrollButton}" Grid.Column="0" Grid.Row="2" Command="{x:Static ScrollBar.LineDownCommand}" CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}">
                            <RepeatButton.Visibility>
                                <MultiBinding FallbackValue="Visibility.Collapsed" Converter="{StaticResource MenuScrollingVisibilityConverter}" ConverterParameter="100">
                                    <Binding Path="ComputedVerticalScrollBarVisibility" RelativeSource="{RelativeSource TemplatedParent}"/>
                                    <Binding Path="VerticalOffset" RelativeSource="{RelativeSource TemplatedParent}"/>
                                    <Binding Path="ExtentHeight" RelativeSource="{RelativeSource TemplatedParent}"/>
                                    <Binding Path="ViewportHeight" RelativeSource="{RelativeSource TemplatedParent}"/>
                                </MultiBinding>
                            </RepeatButton.Visibility>
                            <Path Fill="{DynamicResource {x:Static SystemColors.MenuTextBrushKey}}" Data="{StaticResource DownArrow}"/>
                        </RepeatButton>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <LinearGradientBrush x:Key="MenuItemPressedFill" EndPoint="0,1" StartPoint="0,0">
        <GradientStop Color="#28717070" Offset="0"/>
        <GradientStop Color="#50717070" Offset="0.75"/>
        <GradientStop Color="#90717070" Offset="1"/>
    </LinearGradientBrush>

    <ControlTemplate x:Key="{ComponentResourceKey ResourceId=TopLevelHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Grid SnapsToDevicePixels="true">
            <Rectangle x:Name="OuterBorder" RadiusX="0" RadiusY="0"/>
            <Rectangle Margin="0" x:Name="Bg" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" RadiusX="1" RadiusY="1"/>
            <Rectangle Margin="1" x:Name="InnerBorder"/>
            <DockPanel>
                <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="4,0,6,0" x:Name="Icon" VerticalAlignment="Center" ContentSource="Icon"/>
                <Path Visibility="Collapsed" FlowDirection="LeftToRight" Margin="7,0,0,0" x:Name="GlyphPanel" VerticalAlignment="Center" Fill="{TemplateBinding Foreground}" Data="{StaticResource Checkmark}"/>
                <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="{TemplateBinding Padding}" ContentSource="Header" RecognizesAccessKey="True"/>
            </DockPanel>
            <Popup Focusable="false" AllowsTransparency="true" HorizontalOffset="1" IsOpen="{Binding Path=IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}" VerticalOffset="-1" x:Name="PART_Popup">
                <!--<Microsoft_Windows_Themes:SystemDropShadowChrome x:Name="Shdw" Color="Transparent">-->
                <ContentControl IsTabStop="false" x:Name="SubMenuBorder" Template="{DynamicResource {ComponentResourceKey ResourceId=SubmenuContent, TypeInTargetAssembly={x:Type FrameworkElement}}}">
                    <ScrollViewer Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}" CanContentScroll="true">
                        <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="2" Grid.IsSharedSizeScope="true" KeyboardNavigation.DirectionalNavigation="Cycle" KeyboardNavigation.TabNavigation="Cycle"/>
                    </ScrollViewer>
                </ContentControl>
                <!--</Microsoft_Windows_Themes:SystemDropShadowChrome>-->
            </Popup>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="IsSuspendingPopupAnimation" Value="true">
                <Setter Property="PopupAnimation" TargetName="PART_Popup" Value="None"/>
            </Trigger>
            <Trigger Property="Icon" Value="{x:Null}">
                <Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
            </Trigger>
            <Trigger Property="IsChecked" Value="true">
                <Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible"/>
                <Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
            </Trigger>
            <!--<Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
					<Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
					<Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
				</Trigger>-->
            <Trigger Property="IsHighlighted" Value="true">
                <Setter Property="Fill" TargetName="InnerBorder" Value="{StaticResource MenuBackgroundHover}"/>
                <Setter Property="Stroke" TargetName="InnerBorder" Value="{StaticResource MenuBorderHover}"/>
                <!--<Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource MenuBorder}"/>-->
            </Trigger>
            <!--<Trigger Property="IsKeyboardFocused" Value="true">
					<Setter Property="Stroke" TargetName="Bg" Value="#E0717070"/>
					<Setter Property="Fill" TargetName="Bg" Value="{StaticResource MenuItemPressedFill}"/>
					<Setter Property="Stroke" TargetName="InnerBorder" Value="#50747272"/>
				</Trigger>-->
            <Trigger Property="IsSubmenuOpen" Value="true">
                <Setter Property="Fill" TargetName="OuterBorder" Value="{StaticResource MenuSelected}"/>
                <Setter Property="Fill" TargetName="InnerBorder" Value="Transparent"/>
                <Setter Property="Stroke" TargetName="InnerBorder" Value="{StaticResource MenuInnerBorder}"/>
                <Setter Property="Stroke" TargetName="OuterBorder" Value="{StaticResource MenuBorderHover}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
                <Setter Property="Foreground" Value="#FF9A9A9A"/>
                <Setter Property="Fill" TargetName="GlyphPanel" Value="#848589"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>


    <ControlTemplate x:Key="{ComponentResourceKey ResourceId=TopLevelItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Grid SnapsToDevicePixels="true">
            <Rectangle x:Name="OuterBorder" RadiusX="2" RadiusY="2"/>
            <Rectangle Margin="1" x:Name="Bg" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" RadiusX="1" RadiusY="1"/>
            <Rectangle Margin="2" x:Name="InnerBorder"/>
            <DockPanel>
                <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="4,0,6,0" x:Name="Icon" VerticalAlignment="Center" ContentSource="Icon"/>
                <Path Visibility="Collapsed" FlowDirection="LeftToRight" Margin="7,0,0,0" x:Name="GlyphPanel" VerticalAlignment="Center" Fill="{TemplateBinding Foreground}" Data="{StaticResource Checkmark}"/>
                <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="{TemplateBinding Padding}" ContentSource="Header" RecognizesAccessKey="True"/>
            </DockPanel>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="Icon" Value="{x:Null}">
                <Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
            </Trigger>
            <Trigger Property="IsChecked" Value="true">
                <Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible"/>
                <Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
            </Trigger>
            <Trigger Property="IsHighlighted" Value="true">
                <Setter Property="Stroke" TargetName="Bg" Value="#90717070"/>
                <Setter Property="Stroke" TargetName="OuterBorder" Value="#50FFFFFF"/>
                <Setter Property="Stroke" TargetName="InnerBorder" Value="#50FFFFFF"/>
            </Trigger>
            <Trigger Property="IsKeyboardFocused" Value="true">
                <Setter Property="Stroke" TargetName="Bg" Value="#E0717070"/>
                <Setter Property="Fill" TargetName="Bg" Value="{StaticResource MenuItemPressedFill}"/>
                <Setter Property="Stroke" TargetName="InnerBorder" Value="#50747272"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
                <Setter Property="Foreground" Value="#FF9A9A9A"/>
                <Setter Property="Fill" TargetName="GlyphPanel" Value="#848589"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Geometry x:Key="RightArrow">M 0,0 L 4,3.5 L 0,7 Z</Geometry>


    <ControlTemplate x:Key="{ComponentResourceKey ResourceId=SubmenuHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Grid SnapsToDevicePixels="true">
            <Rectangle x:Name="Bg" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" RadiusX="2" RadiusY="2"/>
            <Rectangle Margin="1" x:Name="InnerBorder" Stroke="Transparent" StrokeThickness="1" RadiusX="2" RadiusY="2"/>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition MinWidth="24" Width="Auto" SharedSizeGroup="MenuItemIconColumnGroup"/>
                    <ColumnDefinition Width="4"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="37"/>
                    <ColumnDefinition Width="Auto" SharedSizeGroup="MenuItemIGTColumnGroup"/>
                    <ColumnDefinition Width="17"/>
                </Grid.ColumnDefinitions>
                <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="1" x:Name="Icon" VerticalAlignment="Center" ContentSource="Icon"/>
                <Border Visibility="Hidden" Margin="1" x:Name="GlyphPanel" Width="22" Height="22" Background="#E6EFF4" BorderBrush="#CDD3E6" BorderThickness="1" CornerRadius="3">
                    <Path FlowDirection="LeftToRight" x:Name="Glyph" Width="9" Height="11" Fill="#0C12A1" Data="{StaticResource Checkmark}"/>
                </Border>
                <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="{TemplateBinding Padding}" Grid.Column="2" ContentSource="Header" RecognizesAccessKey="True"/>
                <TextBlock Visibility="Collapsed" Margin="{TemplateBinding Padding}" Grid.Column="4" Text="{TemplateBinding InputGestureText}"/>
                <Path Margin="4,0,0,0" VerticalAlignment="Center" Fill="{TemplateBinding Foreground}" Grid.Column="5" Data="{StaticResource RightArrow}"/>
            </Grid>
            <Popup Focusable="false" AllowsTransparency="true" HorizontalOffset="-2" IsOpen="{Binding Path=IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Right" PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}" VerticalOffset="-3" x:Name="PART_Popup">

                <!--<Microsoft_Windows_Themes:SystemDropShadowChrome x:Name="Shdw" Color="Transparent">-->
                <ContentControl IsTabStop="false" Template="{DynamicResource {ComponentResourceKey ResourceId=SubmenuContent, TypeInTargetAssembly={x:Type FrameworkElement}}}" x:Name="SubMenuBorder">
                    <ScrollViewer Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}" CanContentScroll="true">
                        <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="2" Grid.IsSharedSizeScope="true" KeyboardNavigation.DirectionalNavigation="Cycle" KeyboardNavigation.TabNavigation="Cycle"/>
                    </ScrollViewer>
                </ContentControl>
                <!--</Microsoft_Windows_Themes:SystemDropShadowChrome>-->
            </Popup>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="IsSuspendingPopupAnimation" Value="true">
                <Setter Property="PopupAnimation" TargetName="PART_Popup" Value="None"/>
            </Trigger>
            <Trigger Property="IsHighlighted" Value="true">
                <Setter Property="Stroke" TargetName="InnerBorder" Value="#D1DBF4FF"/>
            </Trigger>
            <Trigger Property="Icon" Value="{x:Null}">
                <Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
            </Trigger>
            <Trigger Property="IsChecked" Value="true">
                <Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible"/>
                <Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
            </Trigger>
            <!--<Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
					<Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
					<Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
				</Trigger>-->
            <Trigger Property="IsHighlighted" Value="true">
                <Setter Property="Fill" TargetName="Bg" Value="{StaticResource MenuBackgroundHover}"/>
                <Setter Property="Stroke" TargetName="Bg" Value="{StaticResource MenuBorderHover}"/>
                <Setter Property="Stroke" TargetName="InnerBorder" Value="#FFFFFF"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
                <Setter Property="Foreground" Value="#FF9A9A9A"/>
                <Setter Property="Background" TargetName="GlyphPanel" Value="#EEE9E9"/>
                <Setter Property="BorderBrush" TargetName="GlyphPanel" Value="#DBD6D6"/>
                <Setter Property="Fill" TargetName="Glyph" Value="#848589"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>



    <Style TargetType="{x:Type MenuItem}">
        <Setter Property="HorizontalContentAlignment" Value="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
        <Setter Property="VerticalContentAlignment" Value="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=SubmenuItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}"/>
        <Style.Triggers>
            <Trigger Property="Role" Value="TopLevelHeader">
                <Setter Property="Padding" Value="7,2,8,3"/>
                <Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=TopLevelHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}"/>
            </Trigger>
            <Trigger Property="Role" Value="TopLevelItem">
                <Setter Property="Padding" Value="7,2,8,3"/>
                <Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=TopLevelItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}"/>
            </Trigger>
            <Trigger Property="Role" Value="SubmenuHeader">
                <Setter Property="Padding" Value="2,3,2,3"/>
                <Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=SubmenuHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}"/>
            </Trigger>
            <Trigger Property="Role" Value="SubmenuItem">
                <Setter Property="Padding" Value="2,3,2,3"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="{x:Static MenuItem.SeparatorStyleKey}" TargetType="Separator">
        <Setter Property="Height" Value="1"/>
        <Setter Property="Margin" Value="30,4,0,4"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Separator">
                    <Border BorderBrush="{StaticResource MenuBorder}"
	                  BorderThickness="1"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>